package com.hue.springbootvalidation.controller;

import com.hue.springbootvalidation.domain.User;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.validation.Valid;

@RestController
@RequestMapping("/user")
public class UserController {
    @PostMapping("/add")
    public String add(@Valid @RequestBody User user){
        System.out.println(user);
        return "添加成功";
    }
}
